package com.lc.cn.managersys.service.example;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lc.cn.managersys.dao.example.UserDao;

/**
 * service example
 * @author luo_guang
 *
 */
@Service
public class UserService {

	@Autowired
	private UserDao dao = null;
	
	/**
	 * test transaction
	 */
	@Transactional
	public void insertAndDelete() {
		dao.deleteUser();//throw exception
		dao.insertUser();
	}
	
	@SuppressWarnings("unchecked")
	public List listUser() {
		return dao.listUsers();
	}
}
